#ifndef LAYOUTPARENTWIDGET_H
#define LAYOUTPARENTWIDGET_H

#include <QWidget>
#include <QStyle>
#include <QStyleOption>
#include <QStackedLayout>
#include <QDebug>

#include "qpainter.h"
#include "layoutwidget.h"
#include "observer/globalobserver.h"
#include "common.h"

//显示模块数据结构
struct LayoutShowData
{
    Layout layout_data;
    LayoutWidget *layout_widget;
};

class PartitionWidget : public BaseShowWidget
{
    Q_OBJECT
public:
    explicit PartitionWidget(Partition partition, int screen_id, BaseShowWidget *parent = 0);
    void addLayout(Layout one_layout);
    void delLayout(int layout_id);
    void setSelectStyle(bool select);
    void setAllChildrenLossSelect();
    QMap<int, LayoutShowData> getMap() {return m_layouts_data;}
    int setCurrentChangedLayoutFromId(int layout_id);
    void updatePartition(Partition partition);

private:
    QStackedLayout *m_stack_layout;
    Partition m_partition;
    QMap<int, LayoutShowData> m_layouts_data;
    int m_screen_id;
};

#endif // LAYOUTPARENTWIDGET_H
